<?php
// 本类由系统自动生成，仅供测试用途
namespace Home\Controller;
use Think\Controller;
class DptuanController extends Controller {
    public function dptuan(){
      	$this->display();
    }

	public function dptuan2(){
    	$act = M("act");
		$arr = $act->select();
		$this->assign("arr",$arr);
      	$this->display();
    }

    public function dptuan3(){
    	$id = I('act_id');
    	$act = M("act");
		$arr = $act->select($id);
		$this->assign("arr",$arr);
		//print_r($arr);
      	$this->display();
    }

	 public function actSave(){
    	$actid = I('get.actid');
    	$act = M("act")->find($actid);
		//print_r($act);
		$arr["uname"] = $_session["uname"]=0;
		$arr["goods_name"] = $act["act_name"];
		$arr["pro_img"] = $act["act_picture"];
		$arr["goods_desc"] = $act["act_des"];
		$arr["goods_price"] = $act["act_price"];
		$arr["pid"] = $act["act_id"];
		$arr["goods_size"] = $act["act_size"];
		$arr["goods_color"] = $act["act_color"];
		$arr["goods_tc_desc"] = $act["act_dodes"];		
		$r = array();
		if( D('showcar')->add($arr)){
			$r['msg']='订单提交成功';
			$r['status']=true;
		}else{
			$r['msg']='订单提交失败';
			$r['status']=false;
		}
		$this->ajaxReturn($r);
	}

}